// import request from '@/helpers/request';
import { jsonPost, reqGet } from '@/helpers/request';
import apiConfig from '@/apiConfig';

/**
 * 用户登录
 * @param params
 * @returns {*}
 */
export async function userLogin(params) {
  return jsonPost(apiConfig.login, {}, params);
}

///api/auth/webAuthoriztion/open/validateCorpCode
export  async function validateCorpCode(params) {
  return reqGet('/api/auth/webAuthoriztion/open/validateCorpCode', params);
}

// /api/auth/webAuthoriztion/open/validateHost
export  async function validateHost(params) {
  return reqGet('/api/auth/webAuthoriztion/open/validateHost', params);
}


/**
 * 用户注册
 * @param params
 * @param options
 */
export async function registerCorp(params, options) {
  return jsonPost(apiConfig.registerCorp, params, options);
}

/**
 *查询用户的公司
 * @param params
 * @returns {*}
 */
export async function findUserCorp(params) {
  return reqGet(apiConfig.findUserCorp, params);
}

// 根据 code（微信扫码后获得的 code）获取 openid
export async function getWxIDByCode(params) {
  return reqGet(apiConfig.getWxIDByCode, params);
}
//
export async function setSessionByOpenid(params) {
  return reqGet(apiConfig.setSessionByOpenid, params);
}


